package net.sasuke.firstapp;

import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;

public class NameBean implements HttpSessionBindingListener {
   
   private String name = "default";

   public NameBean() {
      super();
   }

   public NameBean(String name) {
      super();
      this.name = name;
   }
   
   public String getName() {
      return name;
   }

   public void setName(String name) {
      this.name = name;
   }

   public String toString() {
      return "[Name: " + this.name + "]";
   }
  
   public void valueBound(HttpSessionBindingEvent event) {
      System.err.println(this + "An attribute with key " + event.getName() +
            " was placed in the session with value : " + event.getValue());
   }

   public void valueUnbound(HttpSessionBindingEvent event) {
      System.err.println(this + "An attribute with key " + event.getName() +
            " was removed from the session with value : " + event.getValue());
   }   

}
